package com.web.mapper;

import com.web.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface DetailsMapper {
    @Select("select * from chargestock")
    public List<Chargestock> queryAllFromChargestock();
    @Select("select * from chargestock where id=#{id}")
    public Chargestock queryByIdFromChargestock(int id);
    @Select("update chargestock set status='charging' where id=#{id}")
    public void updateStatusById(int id);
//    @Select("insert into fixing values(#{id},#{userid},#{time},#{description},#{phone})")
//    public void insertFixing(int id,String userid,String time,String description ,String phone);

    @Select("insert into fixing values(#{id},#{userid},#{time},#{description},#{phone},'未处理')")
    public void insertFixing(Fixing fixing);

    @Select("select c.id,c.category,c.location address,f.userid,'huazi' name,f.time,f.description,f.status status from fixing f,chargestock c where f.id=c.id and f.status='未处理'")
    public List<Restore> queryAllFromFixingJoinChargestock();

    @Select("update fixing set status='正在处理' where id=#{id} and time=#{time}")
    public void updateStatusFromFixingByIdAndTime(Key key);

    @Select("insert into weixiutable values(#{id},#{prodescription},#{protime},#{prostatus},#{time})")
    public void insertWeixiutable(Weixiutable weixiutable);
    @Select("select * from weixiutable")
    public List<Weixiutable> queryAllFromWeixiutable();
}
